package housing.task3.dto;

import housing.task3.dto.PK.HsRenterPk;

import java.io.Serializable;

public class HsRenter implements Serializable {
    /**
     * This attribute maps to the column renter_id in the HS_Renter table.
     */
    protected int renterId;

    /**
     * This attribute maps to the column firstName in the HS_Renter table.
     */
    protected String firstName;

    /**
     * This attribute maps to the column lastName in the HS_Renter table.
     */
    protected String lastName;

    /**
     * This attribute maps to the column address_id in the HS_Renter table.
     */
    protected int addressId;

    /**
     * Method 'HsRenter'
     */
    public HsRenter() {
    }

    /**
     * Method 'getRenterId'
     *
     * @return int
     */
    public int getRenterId() {
        return renterId;
    }

    /**
     * Method 'setRenterId'
     *
     * @param renterId
     */
    public void setRenterId(int renterId) {
        this.renterId = renterId;
    }

    /**
     * Method 'getFirstName'
     *
     * @return String
     */
    public String getFirstName() {
        return firstName;
    }

    /**
     * Method 'setFirstName'
     *
     * @param firstName
     */
    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    /**
     * Method 'getLastName'
     *
     * @return String
     */
    public String getLastName() {
        return lastName;
    }

    /**
     * Method 'setLastName'
     *
     * @param lastName
     */
    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    /**
     * Method 'getAddressId'
     *
     * @return int
     */
    public int getAddressId() {
        return addressId;
    }

    /**
     * Method 'setAddressId'
     *
     * @param addressId
     */
    public void setAddressId(int addressId) {
        this.addressId = addressId;
    }

    /**
     * Method 'equals'
     *
     * @param _other
     * @return boolean
     */
    public boolean equals(Object _other) {
        if (_other == null) {
            return false;
        }

        if (_other == this) {
            return true;
        }

        if (!(_other instanceof HsRenter)) {
            return false;
        }

        final HsRenter _cast = (HsRenter) _other;
        if (renterId != _cast.renterId) {
            return false;
        }

        if (firstName == null ? _cast.firstName != firstName : !firstName.equals(_cast.firstName)) {
            return false;
        }

        if (lastName == null ? _cast.lastName != lastName : !lastName.equals(_cast.lastName)) {
            return false;
        }

        if (addressId != _cast.addressId) {
            return false;
        }

        return true;
    }

    /**
     * Method 'hashCode'
     *
     * @return int
     */
    public int hashCode() {
        int _hashCode = 0;
        _hashCode = 29 * _hashCode + renterId;
        if (firstName != null) {
            _hashCode = 29 * _hashCode + firstName.hashCode();
        }

        if (lastName != null) {
            _hashCode = 29 * _hashCode + lastName.hashCode();
        }

        _hashCode = 29 * _hashCode + addressId;
        return _hashCode;
    }

    /**
     * Method 'createPk'
     *
     * @return HsRenterPk
     */
    public HsRenterPk createPk() {
        return new HsRenterPk(renterId);
    }

    /**
     * Method 'toString'
     *
     * @return String
     */
    public String toString() {
        StringBuffer ret = new StringBuffer();
        ret.append("housing.task3.dto.HsRenter: ");
        ret.append("renterId=" + renterId);
        ret.append(", firstName=" + firstName);
        ret.append(", lastName=" + lastName);
        ret.append(", addressId=" + addressId);
        return ret.toString();
    }

}
